package com.necsv;

import com.necsv.Mylog.Mylog;
import com.necsv.Mylog.Mytoast;

import android.app.Activity;
import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.AdapterView.OnItemClickListener;

public class MenuInitActivity extends ListActivity
{
	final static String INTENT = "intent";
	final static String IMPLICIT_INTENT = "Implicit intent";
	final static String SQLITE1 = "SQLite1";
	static final String PREFERENCES = "preferences";
	static final String MAP = "maps";
	static final String Spinner = "SPINNER & SharePrefs";
	private static final String TABHOST = "TabHost";
	
	static String[]listAction = new String[]{TABHOST, Spinner,"Custom list", INTENT, IMPLICIT_INTENT, SQLITE1,PREFERENCES,"etc..."};
	ArrayAdapter<String>adapter;
	Mytoast mytoast;
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //setContentView(R.layout.main);
        mytoast = new Mytoast(this);
        adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, listAction);
        setListAdapter(adapter);
        getListView().setOnItemClickListener(new OnItemClickListener() {

			public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
					long arg3) {
				// TODO Auto-generated method stub
				String str = "Click: " + getListView().getItemAtPosition(arg2).toString();
				String s = getListView().getItemAtPosition(arg2).toString();
				//mytoast.show(str);
				Intent intent = new Intent();
				
				//startActivity(intent);
			}
		});
        
    }
	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		// TODO Auto-generated method stub
		switch (item.getItemId()) {
		case R.id.item1:
			Mylog.Toat(this, "Item 1");
			Log.v("tag", "Item 1");
			break;
		case R.id.item2:
			Mylog.Toat(this, "Item 2");
			break;

		default:
			break;
		}
		return false;
	}
}
